<template>
    <div>
        <el-card class="box-card" type="card">
            <div slot="header" class="clearfix">
                <span>系统设置</span>
            </div>
            <el-tabs v-model="activeName">

                <el-tab-pane label="管理配置" name="first">
                    <manage :form="form"></manage>
                </el-tab-pane>
                <el-tab-pane label="基础配置" name="second">
                    <baseset :form="form"></baseset>
                </el-tab-pane>
            </el-tabs>
            <el-button type="primary" @click="onSubmit">保存</el-button>
        </el-card>
    </div>
</template>

<script>
import Baseset from './Base.vue'
import Manage from './Manage.vue'
import form from './config.js'

export default {
    route: {path: 'system/edit', meta: {title: '系统配置'}},
    components: {Baseset, Manage},
    data() {
        return {
            form,
            activeName: 'first'
        }
    },
    async created() {
        let data = await this.axios.get('system')
        if (data != "") {
            this.form = data
        }

    },
    methods: {
        async onSubmit() {
            await this.axios.post('admin/system/edit', this.form)
        }
    }

}
</script>

<style scoped>

</style>
